<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class trackable</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../signals/reference.html#header.boost.signals.trackable_hpp" title="Header &lt;boost/signals/trackable.hpp&gt;">
<link rel="prev" href="../slot.html" title="Class template slot">
<link rel="next" href="connection.html" title="Class connection">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../slot.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../signals/reference.html#header.boost.signals.trackable_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="connection.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.signals.trackable"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class trackable</span></h2>
<p>boost::signals::trackable &#8212; Enables safe use of multicast callbacks.</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../signals/reference.html#header.boost.signals.trackable_hpp" title="Header &lt;boost/signals/trackable.hpp&gt;">boost/signals/trackable.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="trackable.html" title="Class trackable">trackable</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// <a class="link" href="trackable.html#boost.signals.trackableconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="trackable.html#idp76743136-bb"><span class="identifier">trackable</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="trackable.html#idp83583744-bb"><span class="identifier">trackable</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="trackable.html" title="Class trackable">trackable</a><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  trackable&amp; <a class="link" href="trackable.html#idp83386768-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="trackable.html" title="Class trackable">trackable</a><span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="trackable.html#idp76580608-bb"><span class="special">~</span><span class="identifier">trackable</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp161079504"></a><h2>Description</h2>
<p>The <code class="computeroutput">trackable</code> class provides automatic
          disconnection of signals and slots when objects bound in
          slots (via pointer or reference) are destroyed. The
          <code class="computeroutput">trackable</code> class may only be used as a public
          base class for some other class; when used as such, that
          class may be bound to function objects used as part of
          slots. The manner in which a <code class="computeroutput">trackable</code> object
          tracks the set of signal-slot connections it is a part of is
          unspecified.</p>
<p>The actual use of <code class="computeroutput">trackable</code> is contingent
          on the presence of appropriate
          <a class="link" href="../visit_each.html" title="Function template visit_each">visit_each</a> overloads for any
          type that may contain pointers or references to trackable
          objects.</p>
<div class="refsect2">
<a name="idp161082736"></a><h3>
<a name="boost.signals.trackableconstruct-copy-destruct"></a><code class="computeroutput">trackable</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp76743136-bb"></a><span class="identifier">trackable</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td><p>Sets the list of connected slots to empty.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td><p>Will not throw.</p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp83583744-bb"></a><span class="identifier">trackable</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="trackable.html" title="Class trackable">trackable</a><span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td><p>Sets the list of connected slots to empty.</p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td><p>Will not throw.</p></td>
</tr>
<tr>
<td><p><span class="term">Rationale:</span></p></td>
<td><p>Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout">trackable&amp; <a name="idp83386768-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="trackable.html" title="Class trackable">trackable</a><span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Effects:</span></p></td>
<td><p>Sets the list of connected slots to empty.</p></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p><code class="computeroutput">*this</code></p></td>
</tr>
<tr>
<td><p><span class="term">Throws:</span></p></td>
<td><p>Will not throw.</p></td>
</tr>
<tr>
<td><p><span class="term">Rationale:</span></p></td>
<td><p>Signal-slot connections can only be created via calls to an explicit connect method, and therefore cannot be created here when trackable objects are copied.</p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idp76580608-bb"></a><span class="special">~</span><span class="identifier">trackable</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Effects:</span></p></td>
<td><p>Disconnects all signal/slot connections that
          contain a pointer or reference to this trackable object that
          can be found by
          <a class="link" href="../visit_each.html" title="Function template visit_each">visit_each</a>.</p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2004 Douglas Gregor<p>Use, modification and distribution is subject to the Boost
    Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../slot.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../signals/reference.html#header.boost.signals.trackable_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="connection.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
